package com.day0927.Rental_cars;

public class Bus extends Vehicle {
    private String b_seat;//座位数

    public Bus() {
    }

    public Bus(String v_brand_name, String v_number, int day_price, String b_seat) {
        super(v_brand_name, v_number, day_price);
        this.b_seat = b_seat;
    }

    public String getB_seat() {
        return b_seat;
    }

    public void setB_seat(String b_seat) {
        this.b_seat = b_seat;
    }

    @Override
    public double totalPrice(int day) {
        double b_discount = bDiscount(day);
        return (day_price * day) * b_discount;
        //return super.totalPrice(day);
    }

    public double bDiscount(int day){
        if (day > 150){
            return 0.6;
        }
        else if (day > 30){
            return 0.7;
        }
        else if (day > 7){
            return 0.8;
        }
        else if (day > 3){
            return 0.9;
        }
        return 1;
    }
}
